package com.linoer.cloud.alo.common.domain.exception;

import com.linoer.cloud.alo.common.domain.enums.ResponseStatus;

/**
 * @Classname ResponseDefaultException
 * @Description TODO
 * @Date 2021/6/22 8:30 下午
 * @Created by muhenglv
 */
public class DefaultException extends RuntimeException {
    private ResponseStatus responseStatus;
    public DefaultException(ResponseStatus status){
        super(status.getMessage());
        this.responseStatus = status;
    }
    public DefaultException(String message, Throwable throwable){
        super(message, throwable);
    }
    public DefaultException(ResponseStatus status, Throwable throwable){
        super(status.getMessage(), throwable);
    }

    public ResponseStatus getResponseStatus() {
        return responseStatus;
    }

    public void setResponseStatus(ResponseStatus responseStatus) {
        this.responseStatus = responseStatus;
    }

    @Override
    public String toString() {
        return "DefaultException{" +
                "responseStatus=" + responseStatus +
                '}';
    }
}
